/*
 * =====================================================================================
 *
 *       Filename:  test.cpp
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  2012/2/28 23:57:47
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  YOUR NAME (), 
 *   Organization:  
 *
 * =====================================================================================
 */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#include <iostream>
#include <algorithm>

#define N 393217
using namespace std;

int main()
{
   int n,m,i;
   int temp;
   int a[N];
   int x;
   a[N-1] = 4;
   cin>> n>> m;
   for(i=0; i<N; i++)
        a[i] = 0;
   for(i=0; i<m; i++){
        cin>>temp;
        a[temp-1]++;
   }
   for(i=0; i<N; i++)
       if(a[i] != 0 && a[i] != n){
            cout<<i + 1;
            break;
       }

}

